That way, I don't need to recreate all the tests I don't care about.
This is particularly useful when I want to change the size of the
testcase.
};
GError *error = NULL;
GskRenderNode *node;
+ GPatternSpec *matcher;
+ char *pattern;
guint i, n;
gtk_init (&argc, &argv);
+ n = 100000;
+ pattern = "*";
+
if (argc > 1)
- n = atoi (argv[1]);
- else
- n = 100000;
+ {
+ if (argc > 2)
+ pattern = argv[2];
+ n = atoi (argv[1]);
+ }
+
+ matcher = g_pattern_spec_new (pattern);
for (i = 0; i < G_N_ELEMENTS (functions); i++)
{
+ if (!g_pattern_match_string (matcher, functions[i].name))
+ continue;
+
node = functions[i].func (n);
if (!gsk_render_node_write_to_file (node, functions[i].name, &error))
{
g_print ("Created test file \"%s\".\n", functions[i].name);
}
+ g_pattern_spec_free (matcher);
+
return 0;
}